<template>
  <div id="app">
    <img src="./assets/logo.png">
    <router-view></router-view>

    <!-- 这里带参数调用函数 不同参数就匹配不同的路由 -->
    <button v-on:click='chooseMe(1)'>1</button>
    <button v-on:click='chooseMe(2)'>2</button>
    <button v-on:click='chooseMe(3)'>3</button>
  </div>
</template>

<script>
import router from './router'

export default {
  name: 'App',
  methods: {
    // 根据选择的按钮进行页面跳转 或者 按钮颜色变换
    chooseMe: function (i) {
      switch (i) {
        case 1:
          router.push('/h')
          break
        case 2:
          router.push('/n')
          break
        case 3:
          router.push('/')
          break
      }
    }
  }
}
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
  }
</style>
